import service from '@/utils/request'

export const saveMasterModelApi = (dataForm: nay) => {
	return service.post('/data-governance/master-model', dataForm)
}

export const getMasterModelApiById = (id: nay) => {
	return service.get('/data-governance/master-model/by-id/' + id)
}

export const getMasterModelApi = (catalogId: nay) => {
	return service.get('/data-governance/master-model/' + catalogId)
}

export const updateMasterModelApi = (dataForm: nay) => {
	return service.put('/data-governance/master-model', dataForm)
}

export const deleteMasterModelApi = (id: number) => {
	return service.delete('/data-governance/master-model/' + id)
}

export const releaseMasterModelApi = (id: number) => {
	return service.put('/data-governance/master-model/release/' + id)
}

export const cancelReleaseMasterModelApi = (id: number) => {
	return service.put('/data-governance/master-model/cancel-release/' + id)
}


// 主数据模型 分区信息查询
export const getMasterModelPartitionApi = (id: number) => {
    return service.get('/data-governance/master-model/partition_info?masterModelId=' + id)
}

// 主数据模型 索引信息查询
export const getMasterModelIndexApi = (id: number) => {
    return service.get('/data-governance/master-model/index_info?masterModelId=' + id)
}

// 主数据模型 sql执行
export const getMasterModelSqlExecuteApi = (data) => {
    return service({
		url: '/data-governance/master-model/just-execute-sql',
		method: 'post',
		data
	})
}

// 主数据模型 日志清空
export const getMasterModelLogClearApi = () => {
    return service.get('/data-governance/master-model/clear-log')
}